#!/usr/bin/env bash
set -euo pipefail

debian="${1:-false}"

if $debian; then
   image="debian"
   setup_cmd="apt update; apt install -y git curl;"
else
   image="ellerbrock/alpine-bash-git"
fi

docker run \
   -it \
   --entrypoint /bin/bash \
   -v "$(pwd):/navi" \
   "$image" \
   -c "${setup_cmd:-}git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && yes | ~/.fzf/install; export PATH=$PATH:/navi; bash"